package com.xzy.urp.service.mq;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Service;

@Service
public class MQSender {
    private final RabbitTemplate rabbitTemplate;

    public MQSender(RabbitTemplate rabbitTemplate) {
        this.rabbitTemplate = rabbitTemplate;
    }
    public void incrTicket(Long cid){
        rabbitTemplate.convertAndSend("urpExchange","urp.stock.incr",cid);
    }
    public void decrTicket(Long cid){
        rabbitTemplate.convertAndSend("urpExchange","urp.stock.decr",cid);
    }

}
